#include "PacketController.h"
#include "Packet.h"
#include "Codec.h"
#include "ssu_aes.h"
#define BUF_SIZE 1024
char *PacketHandler(char *buffer,unsigned long *length) {
	PACKET *packet;
	PACKET_DATA *data;
	PACKET_HEADER *head;
	MSG_LOGIN_REQ_DATA *mlrd;
	MSG_LOGIN_ACK_DATA *mlad;
	char decryptedId[BUF_SIZE];
	char decryptedPwd[BUF_SIZE];
	packet = decode_PACKET(buffer,length);
	switch(packet->header->msgType){
		case MSG_LOGIN_REQ :
			mlrd = (MSG_LOGIN_REQ_DATA *) packet->data;
			ssu_decrypt((unsigned char *) mlrd->id,
							(unsigned char *) decryptedId,
							(unsigned char *) "INrWXyrD3KCIOTr5", 16);
			ssu_decrypt((unsigned char *) mlrd->pwd,
										(unsigned char *) decryptedPwd,
										(unsigned char *) "INrWXyrD3KCIOTr5", 16);

	}
}
